package com.ucode.model.hrm.vo;

import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.StrUtil;
import com.ucode.model.hrm.HrmEmployee;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

@Schema(description = "人力资源系统 - 员工信息VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class HrmEmployeeVO extends HrmEmployee {

    /**
     * 客户公司名称
     */
    private String companyName;

    /**
     * 客户项目名称
     */
    private String projectName;
    /**
     * 考勤组名称
     */
    private String attCfgTitle;


    /**
     * 员工年龄
     */
    private Integer age;

    public Integer getAge() {

        if(StrUtil.isNotBlank(this.getIdCardNumber())){
            age =  IdcardUtil.getAgeByIdCard(this.getIdCardNumber());
        }
        return age;
    }
}
